import request from '/@/utils/request';

// 查询商品规格关联关系列表
export function listRelation(query?: Object) {
  return request({
    url: '/module/rule/relation/list',
    method: 'get',
    params: query
  })
}

// 查询商品规格关联关系详细
export function getRelation(id?: number) {
  return request({
    url: '/module/rule/relation/' + id,
    method: 'get'
  })
}

// 新增商品规格关联关系
export function addRelation(data?: Object) {
  return request({
    url: '/module/rule/relation',
    method: 'post',
    data: data
  })
}

// 修改商品规格关联关系
export function updateRelation(data?: Object) {
  return request({
    url: '/module/rule/relation',
    method: 'put',
    data: data
  })
}

// 删除商品规格关联关系
export function delRelation(id?: number) {
  return request({
    url: '/module/rule/relation/' + id,
    method: 'delete'
  })
}

// 导出商品规格关联关系
export function exportRelation(query?: Object) {
  return request({
    url: '/module/rule/relation/export',
    method: 'get',
    params: query
  })
}
